#define _CRT_SECURE_NO_WARNINGS 1


#include<vector>
#include<iostream>

using namespace std;

int main()
{
	int n = 0, m = 0;
	cin >> n >> m;
	vector<int> v(n + 1), temp;
	for (int i = 1; i <= n; i++)
	{
		v[i] = 1;
	}
	for (int i = 1; i <= m; i++)
	{
		if (i == 1)
		{
			for (int j = 1; j <= n; j++)
			{
				v[j] = 0;
			}
		}
		else if (i == 2)
		{
			for (int j = 1; j <= n; j++)
			{
				if (j % 2 == 0)
				{
					v[j] = 1;
				}
			}
		}
		else
		{
			for (int j = 1; j <= n; j++)
			{
				if (j % i == 0)
				{
					if (v[j] == 1)
					{
						v[j] = 0;
					}
					else
					{
						v[j] = 1;
					}
				}
			}
		}
	}
	for (int i = 1; i <= n; i++)
	{
		if (v[i] == 0)
		{
			temp.push_back(i);
		}
	}
	int size = temp.size();
	for (int i = 0; i < size - 1; i++)
	{
		cout << temp[i] << ',';
	}
	cout << temp[size - 1] << endl;

	return 0;
}